package com.java.system.common.entity.admin;


import com.java.system.common.validatedGroup.Add;
import com.java.system.common.validatedGroup.Modify;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * 部门表(SysOrganization)实体类
 *
 * @author makejava
 * @since 2019-06-06 13:19:17
 */
@ApiModel(value = "部门表")
@Data
@Accessors(chain = true)
public class SysOrganization implements Serializable {
    private static final long serialVersionUID = -17386461197110046L;
    @ApiModelProperty(value = "主键Id")
    @Id
    @Null(message = "{add_id}", groups = {Add.class})
    @NotNull(message = "{modify_id}", groups = {Modify.class})
    private String id;
    //上级部门id
    @ApiModelProperty(value = "父Id")
    private String parentId;
    //部门编号
    @ApiModelProperty(value = "部门编号")
    private String orgCode;
    //部门名称
    @ApiModelProperty(value = "部门名称")
    @NotBlank(message = "{name_null}")
    @Pattern(regexp = "^[\\s\\S]{1,20}$", message = "{name_rule}")
    private String orgName;
    //部门英文名称
    @ApiModelProperty(value = "部门英文名称")
    @Pattern(regexp = "^$|[a-zA-Z\\s]{1,30}$", message = "{enname_rule}")
    private String orgEname;
    //部门等级
    @ApiModelProperty(value = "部门等级")
    private Integer orgLevel;
    //部门id路径，多路径之间用逗号分隔
    @ApiModelProperty(value = "部门id路径")
    private String path;
    //公司id
    @ApiModelProperty(value = "公司id")
    private String coId;
    //创建人id
    private String crtUser;
    //创建人名称
    private String crtName;
    //创建时间
    private Date crtTime;
    //最后修改人id
    private String updUser;
    //最后修改人名称
    private String updName;
    //最后修改时间
    private Date updTime;
    //备注
    private String remark;
    //逻辑删除标识：1=删除；0=未删除
    private Object delFlag;

    private String attr1;

    private String attr2;

    private String attr3;


    /*****************************以下为添加字段*********************************/
    @Transient
    private Boolean hasChildren;
    @Transient
    private Boolean hasChecked;
    @Transient
    private List<SysOrganization> children = new LinkedList<SysOrganization>();
}